3.1.50 \(\int \cot ^2(c+d x) (a+a \sec (c+d x))^3 \, dx\) [50]

Optimal. Leaf size=49 \[ -a^3 x+\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d} \]

[Out]

-a^3*x+a^3*arctanh(sin(d*x+c))/d-4*a^3*cot(d*x+c)/d-4*a^3*csc(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3971, 3554, 8, 2686, 3852, 2701, 327, 213} \begin {gather*} -\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d}+\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}+a^3 (-x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2*(a + a*Sec[c + d*x])^3,x]

[Out]

-(a^3*x) + (a^3*ArcTanh[Sin[c + d*x]])/d - (4*a^3*Cot[c + d*x])/d - (4*a^3*Csc[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2701

Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(f*a^n)^(-1), Subst
[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && Integer
Q[(n + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3971

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[ExpandI
ntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]

Rubi steps

\begin {align*} \int \cot ^2(c+d x) (a+a \sec (c+d x))^3 \, dx &=\int \left (a^3 \cot ^2(c+d x)+3 a^3 \cot (c+d x) \csc (c+d x)+3 a^3 \csc ^2(c+d x)+a^3 \csc ^2(c+d x) \sec (c+d x)\right ) \, dx\\ &=a^3 \int \cot ^2(c+d x) \, dx+a^3 \int \csc ^2(c+d x) \sec (c+d x) \, dx+\left (3 a^3\right ) \int \cot (c+d x) \csc (c+d x) \, dx+\left (3 a^3\right ) \int \csc ^2(c+d x) \, dx\\ &=-\frac {a^3 \cot (c+d x)}{d}-a^3 \int 1 \, dx-\frac {a^3 \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}-\frac {\left (3 a^3\right ) \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}-\frac {\left (3 a^3\right ) \text {Subst}(\int 1 \, dx,x,\csc (c+d x))}{d}\\ &=-a^3 x-\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d}-\frac {a^3 \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-a^3 x+\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(109\) vs. \(2(49)=98\).
time = 0.25, size = 109, normalized size = 2.22 \begin {gather*} -\frac {a^3 (1+\cos (c+d x))^3 \sec ^6\left (\frac {1}{2} (c+d x)\right ) \left (d x+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 \csc \left (\frac {c}{2}\right ) \csc \left (\frac {1}{2} (c+d x)\right ) \sin \left (\frac {d x}{2}\right )\right )}{8 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^2*(a + a*Sec[c + d*x])^3,x]

[Out]

-1/8*(a^3*(1 + Cos[c + d*x])^3*Sec[(c + d*x)/2]^6*(d*x + Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c
 + d*x)/2] + Sin[(c + d*x)/2]] - 4*Csc[c/2]*Csc[(c + d*x)/2]*Sin[(d*x)/2]))/d

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 79, normalized size = 1.61

method result size
risch \(-a^{3} x -\frac {8 i a^{3}}{d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(71\)
derivativedivides \(\frac {a^{3} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 a^{3} \cot \left (d x +c \right )-\frac {3 a^{3}}{\sin \left (d x +c \right )}+a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) \(79\)
default \(\frac {a^{3} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 a^{3} \cot \left (d x +c \right )-\frac {3 a^{3}}{\sin \left (d x +c \right )}+a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) \(79\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2*(a+a*sec(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^3*(-1/sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))-3*a^3*cot(d*x+c)-3*a^3/sin(d*x+c)+a^3*(-cot(d*x+c)-d*x-c))

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 85, normalized size = 1.73 \begin {gather*} -\frac {2 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{3} + a^{3} {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {6 \, a^{3}}{\sin \left (d x + c\right )} + \frac {6 \, a^{3}}{\tan \left (d x + c\right )}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/2*(2*(d*x + c + 1/tan(d*x + c))*a^3 + a^3*(2/sin(d*x + c) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1))
+ 6*a^3/sin(d*x + c) + 6*a^3/tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 3.16, size = 84, normalized size = 1.71 \begin {gather*} -\frac {2 \, a^{3} d x \sin \left (d x + c\right ) - a^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + a^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 8 \, a^{3} \cos \left (d x + c\right ) + 8 \, a^{3}}{2 \, d \sin \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^3,x, algorithm="fricas")

[Out]

-1/2*(2*a^3*d*x*sin(d*x + c) - a^3*log(sin(d*x + c) + 1)*sin(d*x + c) + a^3*log(-sin(d*x + c) + 1)*sin(d*x + c
) + 8*a^3*cos(d*x + c) + 8*a^3)/(d*sin(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int 3 \cot ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 \cot ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \cot ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int \cot ^{2}{\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2*(a+a*sec(d*x+c))**3,x)

[Out]

a**3*(Integral(3*cot(c + d*x)**2*sec(c + d*x), x) + Integral(3*cot(c + d*x)**2*sec(c + d*x)**2, x) + Integral(
cot(c + d*x)**2*sec(c + d*x)**3, x) + Integral(cot(c + d*x)**2, x))

________________________________________________________________________________________

Giac [A]
time = 0.52, size = 66, normalized size = 1.35 \begin {gather*} -\frac {{\left (d x + c\right )} a^{3} - a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {4 \, a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+a*sec(d*x+c))^3,x, algorithm="giac")

[Out]

-((d*x + c)*a^3 - a^3*log(abs(tan(1/2*d*x + 1/2*c) + 1)) + a^3*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 4*a^3/tan(
1/2*d*x + 1/2*c))/d

________________________________________________________________________________________

Mupad [B]
time = 1.20, size = 35, normalized size = 0.71 \begin {gather*} -\frac {a^3\,\left (4\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )+d\,x\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^2*(a + a/cos(c + d*x))^3,x)

[Out]

-(a^3*(4*cot(c/2 + (d*x)/2) - 2*atanh(tan(c/2 + (d*x)/2)) + d*x))/d

________________________________________________________________________________________